package com.liu.yupao.model.vo;

import com.liu.yupao.model.entity.Team;
import com.liu.yupao.utils.CopyUtils;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * @author lqh
 * @since 2025-10-11 21:45
 * 队伍响应类
 */
@Data
public class TeamUserVO implements Serializable {

    private static final long serialVersionUID = 4380521600410375933L;
    /**
     * id
     */
    private Long id;

    /**
     * 创建用户id
     */
    private Long userId;

    /**
     * 队伍名称
     */
    private String name;

    /**
     * 最大人数
     */
    private Integer maxNum;

    /**
     * 队伍描述
     */
    private String description;

    /**
     * 过期时间
     */
    private Date expireTime;

    /**
     * 0-公开 1-私有 2-加密
     */
    private Integer status;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新时间
     */
    private Date updateTime;

    /**
     * 用户信息(创建人)
     */
    private UserVO createUser;


    //Team--->TeamUserVO
    public static TeamUserVO toTeamVO(Team team){
        if (team==null){
            return null;
        }
        return CopyUtils.copy (team, TeamUserVO.class);
    }

}
